<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./emall.xhtml">

    <ui:define name="content">
        <f:view>
            <h:form>
                <h3><h:outputText value="Liste de produits du magasin : #{mbUsers.magasinChoisi.nom}"/></h3>
                <h:dataTable class="table table-striped" value="#{mbUsers.magasinChoisi.produits}" var="item">
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Image"/>
                        </f:facet>
                        <h:graphicImage id="image"
                            alt="jsf-sun"
                            url="#{item.lienImage}"
                            width="50"
                            height="50">
                        </h:graphicImage>  
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Nom"/>
                        </f:facet>
                        <h:outputText value="#{item.nom}"/>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Description"/>
                        </f:facet>
                        <h:outputText value="#{item.description}"/>
                    </h:column>
                    
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Prix"/>
                        </f:facet>
                        <h:outputText value="#{item.prix}  &euro;"/>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Action"/>
                        </f:facet>
                        <p style="width: 150px;">
                            <h:commandLink action="#{mbUsers.modifierProduit(item)}" value="Modifier" class="btn btn-mini btn-primary" />&nbsp;&nbsp;
                            <h:commandLink action="#{mbUsers.enleverProduit(item)}" value="Supprimer" class="btn btn-mini btn-primary" />
                        </p>
                    </h:column>
                </h:dataTable>
            </h:form>
            <h3>Location</h3>
            <iframe align="center" style="border: 0" src="http://localhost:8080/WSemallAmazon/resources/entity.magasin/#{mbUsers.magasinChoisi.adresse} #{mbUsers.magasinChoisi.codepostal} #{mbUsers.magasinChoisi.ville}" height="350" width="550"/>
        </f:view>

    </ui:define>

</ui:composition>
